package com.yzh.wanandroid.adapter

import androidx.viewpager2.adapter.FragmentStateAdapter
import com.yzh.wanandroid.component.activity.MainActivity
import com.yzh.wanandroid.component.fragment.WxArticleFragment
import com.yzh.wanandroid.network.retrofit.responsebean.TitleData

class PublicPagerAdapter(mainActivity: MainActivity, var datas: List<TitleData>) :
    FragmentStateAdapter(mainActivity) {

    override fun getItemCount() = datas.size

    override fun createFragment(position: Int) = WxArticleFragment(datas[position])
}